<?php

namespace app\index\controller\token;

use ShidianUtil\Thinkphp\Response\ApiResponse;
use ShidianUtil\Utils\CheckUtil;
use app\index\model\UM as UM;
use app\index\service\TokenAccountService;
use think\APP;
use think\Request as Request;

/**
 * TokenAccount 控制器
 * Class TokenAccount
 * @package app\index\controller\token;
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 * @see \app\index\validate\token\TokenAccount
 */
class TokenAccount
{
    // 请求参数
    private Request $request;

    // service
    private TokenAccountService $service;

    public function __construct(Request $request, TokenAccountService $tokenAccountService)
    {
        $this->request = $request;
        $this->service = $tokenAccountService;
    }

    /**
     * 详情
     * @param UM $user
     * @return ApiResponse
     * @url /token/token_account/read
     */
    public function read(UM $user): ApiResponse
    {
        return ApiResponse::success($this->service->read($user));
    }

}
